package com.prs.crm.dao.online.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.online.VoteDao;
import com.prs.crm.domain.online.Vote;

public class VoteDaoImpl extends BaseDaoImpl<Vote> implements VoteDao{

	@SuppressWarnings("unchecked")
	@Override
	public List<Vote> getVote(String[] name) {
		Criteria criteria=this.getSession().createCriteria(Vote.class);
		criteria.add(Restrictions.in("content", name));
		return criteria.list();
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Vote> getAllVote() {
		Criteria criteria=this.getSession().createCriteria(Vote.class);
		return criteria.list();
	}

}
